<?php
namespace app\demo\controller;
use think\Controller;
use think\Db;

class Index extends Controller
{
    public function index()
    {
        $data = Db::name('nav')->where('show',0)->order('sort','asc')->select();

        $new_data = Tree($data,0);
        //echo '<pre>';
        //print_r($new_data);
        $this->assign('data',$new_data);

        $data1 = Db::name('img')->where('is_visible',1)->order('sort','asc')->select();
        //dump($data1);die;
        $this->assign('row',$data1);
        return view();
    }
}
